﻿using BP.En;

namespace BP.Sys
{
	/// <summary>
	/// 实体安全策略
	/// </summary>
    public class EnTable : EntityNoName
    {
        #region 构造方法
        /// <summary>
        /// 实体安全策略
        /// </summary>
        public EnTable()
        {
        }
        /// <summary>
        /// 重写基类方法
        /// </summary>
        public override Map EnMap
        {
            get
            {
                if (this._enMap != null)
                    return this._enMap;

                Map map = new Map("Sys_EnCfg", "实体安全策略");

                map.AddTBStringPK("No", null, "标记", false, false, 1, 100, 60);
                map.AddTBString("TableName", null, "表", true, true, 0, 30, 60, true);
                map.AddTBString("Name", null, "中文名", true, false, 0, 30, 60, true);
                map.AddTBString("FieldOfRec", null,"创建人字段", true, false, 0, 30, 60, false);
                map.AddTBString("FieldOfDeptNo", null,"部门字段", true, false, 0, 30, 60, false);
                map.AddTBString("FieldOfOrgNo", null,"组织字段", true, false, 0, 30, 60, false);
                map.AddTBString("OrgNo", null, "隶属组织", true, true, 0, 30, 60);
                //map.AddHidden("No", " LIKE ", 'EnTable_%'); //设置查询.
                this._enMap = map;
                return this._enMap;
            }
        }
        #endregion
    }
    /// <summary>
    /// 实体安全策略
    /// </summary>
    public class EnTables : EntitiesNoName
    {
        /// <summary>
        /// 实体安全策略
        /// </summary>
        public EnTables() { }
        /// <summary>
        /// 得到它的 Entity 
        /// </summary>
        public override Entity GetNewEntity
        {
            get
            {
                return new EnTable();
            }
        }
        #region 为了适应自动翻译成java的需要,把实体转换成List.
        /// <summary>
        /// 转化成 java list,C#不能调用.
        /// </summary>
        /// <returns>List</returns>
        public System.Collections.Generic.IList<EnTable> ToJavaList()
        {
            return (System.Collections.Generic.IList<EnTable>)this;
        }
        /// <summary>
        /// 转化成list
        /// </summary>
        /// <returns>List</returns>
        public System.Collections.Generic.List<EnTable> Tolist()
        {
            System.Collections.Generic.List<EnTable> list = new System.Collections.Generic.List<EnTable>();
            for (int i = 0; i < this.Count; i++)
            {
                list.Add((EnTable)this[i]);
            }
            return list;
        }
        #endregion 为了适应自动翻译成java的需要,把实体转换成List.
    }
}
